package cn.com.fuhuitong.main.order.mode

import cn.com.fuhuitong.http.BaseApiService
import cn.com.fuhuitong.http.BaseResponse
import cn.com.fuhuitong.main.order.entity.*
import io.reactivex.Observable
import retrofit2.http.*

interface OrderApi : BaseApiService {


    @POST("/api/order/confirm_order")
    fun confirmOrder(
        @Header("token") token: String,
        @Body entity: SubmitConfirmEntity
    ): Observable<SubmitGoodsResponse>

    @POST("/api/order/use_score")
    fun useScore(
        @Header("token") token: String
    ): Observable<SubmitNatureResponse>


    @POST("/api/order/submit_order")
    fun submitOrder(
        @Header("token") token: String,
        @Body entity: SubmitConfirmEntity
    ): Observable<SubmitOrderIdResponse>


    @GET("/api/order/order_pay")
    fun orderPay(
        @Header("token") token: String,
        @Query("order_id") orderId: String
    ): Observable<PayResponse>


    @GET("/api/order/order_list")
    fun orderList(
        @Header("token") token: String,
        @Query("page") page: String,
        @Query("limit") limit: String,
        @Query("type") type: String
    ): Observable<OrderListResponse>


    @GET("/api/order/order_detial")
    fun orderDetail(
        @Header("token") token: String,
        @Query("order_id") orderId: String
    ): Observable<OrderDetailsResponse>

    @FormUrlEncoded
    @POST("/api/order/order_cancel")
    fun orderCancel(
        @Header("token") token: String,
        @Field("order_id") orderId: String
    ): Observable<BaseResponse>

    @FormUrlEncoded
    @POST("/api/order/order_confirm")
    fun orderConfirm(
        @Header("token") token: String,
        @Field("order_id") orderId: String
    ): Observable<BaseResponse>
}